package com.jiazhong.basic.shuxin.design.单例模式;

// 单例模式：双重校验懒加载模式
public class DemoD {

    private static volatile DemoD instance;

    private DemoD() {
    }

    public static DemoD getInstance() {
        if (instance == null) {
            synchronized (DemoD.class) {
                if (instance == null) {
                    instance = new DemoD();
                }
            }
        }
        return instance;
    }
}
